#include <stdbool.h>
#include "board.h"
#include "led.h"
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"

// 二值信号量句柄
QueueHandle_t dht_init_bin;
SemaphoreHandle_t voice_ctr_rx_binary;
SemaphoreHandle_t wfi_wait_user_binary;

// 队列句柄
QueueHandle_t extern_to_oled_queue;
QueueHandle_t extern_to_oled_data;

// 互斥信号量句柄
SemaphoreHandle_t wfi_user_mutex_bin; // 互斥信号量句柄

int main(void) 
{   
    dht_init_bin = xSemaphoreCreateBinary();                // 用于DHT11初始化的二值信号量
    voice_ctr_rx_binary = xSemaphoreCreateBinary();         // 用于语音模块接收的二值信号量
    wfi_wait_user_binary = xSemaphoreCreateBinary();        // 用于等待用户操作的二值信号量
    extern_to_oled_queue = xQueueCreate(2, sizeof(double));
    extern_to_oled_data = xQueueCreate(2, sizeof(float));
    wfi_user_mutex_bin = xSemaphoreCreateMutex();

    xSemaphoreGive(voice_ctr_rx_binary);
    xSemaphoreGive(dht_init_bin);
    board_lowlever_init();
}
